package Administrator.AdministratorMainFrame.AdministratorMainFrameModel;

import java.io.*;

import Packet.*;

import Administrator.AdministratorMainFrame.AdministratorMainFrameModel.*;

public class ReceivePacketThread extends Thread
{
    public ReceivePacketThread(AdministratorThread thread)
    {
        this.adminstratorThread = thread;
    }
    
    public void run()
    {
        try
        {
        	Packet packet = (Packet)this.adminstratorThread.getInputStream().readObject();
        	this.adminstratorThread.dealPacket(packet);
        }
        catch(IOException exception)
        {
        	exception.printStackTrace();
        }
        catch(ClassNotFoundException exception)
        {
        	exception.printStackTrace();
        }
    }
    
    private AdministratorThread adminstratorThread;
}
